package com.itheima.talismanagementhomework.controller;

import com.itheima.talismanagementhomework.pojo.Clazz;
import com.itheima.talismanagementhomework.pojo.Result;
import com.itheima.talismanagementhomework.service.ClazzService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/clazzs")
public class ClazzController {
    @Autowired
    private ClazzService clazzService;
    @PostMapping
    public Result add(@RequestBody Clazz clazz) {
        System.out.println("添加班级：" + clazz);
        clazzService.add(clazz);
        return Result.success();
    }
}
